// document.write('search something...')

// 'use strict';

// import React from 'react';
// import './search.less';
// import img1 from './imgs/101.jpg';
// import '../../common/index';
// import { a } from './tree-shaking';
// import largeNumber from 'lss-largenumber';

const React = require('react');
require('./search.less');
const img1 = require('./imgs/101.jpg').default;
console.log('img1', img1);
require('../../common/index');
const a = require('./tree-shaking').a;
const largeNumber = require('lss-largenumber');


class Search extends React.Component {

    constructor() {
        super(...arguments);

        this.state = {
            Text: null
        };
    }

    loadComponent() {
        import('./text.js').then( (TextComponent) => {
            this.setState({
                Text: TextComponent.default
            });
        } );
    }

    render() {
        const strA = a();
        // debugger;
        const { Text } = this.state;
        const addResult = largeNumber('999', '3');
        return <div className="search-text">
            <div>
                {
                    Text ? <Text /> : null
                }
            </div>
            <div>
                { addResult }
            </div>
            <div>
                Search Text, hello webpack, 你好, 你好长城!
            </div>
            <div>
                { strA } 
            </div>
            <div>
                <img src={ img1 } onClick={ this.loadComponent.bind(this) }></img>
            </div>
        </div>;
    }
}

module.exports = <Search />;
